﻿using CID.Domain.Infrastructure;
using CID.Tests.Support;
using NUnit.Framework;
using Rhino.Mocks;

namespace CID.Domain.Tests.Infrastructure
{
    [TestFixture]
    class PackageTests : BaseFunctionalTests
    {
        #region Constructor
        [Test]
        public void CreateNewPackage_ShouldSucceed()
        {
            var type = StubsBuilder.BuildPackageTypeStub();
            var version = Development.StubsBuilder.BuildVersionStub();
            var content = new byte[]{ 1, 2, 3};
            var comment = "This is the package";

            var package = new Package(type, version, content, comment);

            Assert.AreEqual(type, package.Type);
            Assert.AreEqual(version, package.Version);
            Assert.AreEqual(content, package.Content);
            Assert.AreEqual(comment, package.Comment);
            version.AssertWasCalled(x => x.AddPackage(package));
        }
        #endregion
    }
}
